Skip to content

feat: record a demo script in a sandbox as a silent MP4 with step timings (#2) - #10

Merged
codeonym merged 2 commits into
mainfrom
feat/2-silent-replay-recording-sandbox
Nov 10, 2026
Merged

codeonym merged 2 commits into
mainfrom
feat/2-silent-replay-recording-sandbox

Conversation

@codeonym

@codeonym codeonym commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

What

flow-reel record demo.ts replays a Playwright demo script in a container (Xvfb + headed Chromium in kiosk mode)
while ffmpeg captures the display, and writes:

  • demo.mp4: silent, 1920×1080, 30 fps
  • demo.transcript.json: each step's timings (schema v1)
  • demo.events.json: the runner's moves, clicks, typing and scrolls (schema v1)
  • .flow-reel/demo/master.mp4: the 2560×1440 master for later polish, in a folder that git-ignores itself

The script gets a wrapped page: actions ease the mouse to their target and type visibly, so the polish tickets can
draw the cursor, zooms and click sounds from events.json.

Why

There was no way to record an agent's demo headlessly and reproducibly. Runs are stabilised (fixed viewport, clock,
random seed, reduced motion, a network-idle wait and time budgets per action) so the same script gives the same
video: the same steps, each starting within ±150 ms.

Design: planning/GH-1-narrated-reproducible-feature-demos/ (story decisions 009–013, GH-2 decisions 001–007).

How it was tested

  • npm run typecheck, npm test: 36 unit tests (schemas, easing, wrapped page, loader, launcher arguments, network
    idle).
  • npm run test:e2e: builds the image and records a fixture app twice. It checks the resolutions and frame count,
    that both JSON files validate, step starts within ±150 ms between runs, and clicks within 2 frames of the video
    frame where they show.
  • The README path, from an npm pack install into an empty project.
  • On a machine with a load average over ~10, the recording fails with a clear error instead of producing a video
    with wrong timing (decision 007).

Closes #2

@codeonym
codeonym merged commit 1fa4e5d into main Nov 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replay a demo script on a virtual display and write a silent MP4 with step timings

1 participant